<template>
	<view>
		<u-navbar title="身份验证" @rightClick="rightClick" :placeholder="true" :autoBack="true"></u-navbar>
		<view class="page">
			<view class="phoneView">
				<view class="tips">
					验证码发送至{{utils.encryptionMobile(phone)}}
				</view>
			</view>
			<view class="btn">
				<u-button color="#28AC3E" text="发送验证码" @click="sendCode"></u-button>
			</view>
			<view class="bottom-tips">
				若原手机号已停用，请联系4S店管理员
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Info: this.$store.state.Info,
				phone: uni.getStorageSync("urlParams").mobile,
				type: 0,
			}
		},
		onLoad(options) {
			this.type = options.type;
			// this.phone = this.utils.encryptionMobile(this.Info.phone);			
		},
		methods: {
			rightClick() {

			},
			sendCode() {
				uni.showLoading({
					title: "正在获取验证码",
					mask: true
				})
				this.api.sendMsg({
					mobile: this.phone,
					id: uni.getStorageSync("Info").id,
					type: 11
				}).then(res => {
					uni.hideLoading();
					uni.$u.toast("验证码发送成功");
					setTimeout(() => {
						uni.redirectTo({
							url: "/pages/authentication/inputCode?type=" + this.type
						})
					}, 2000)
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	page {
		background-color: #F6F6F6;
	}

	.page {
		margin: 20rpx;
	}

	// ::v-deep .u-status-bar {
	// 	height: 80rpx !important;
	// }

	.phoneView {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-top: 120rpx;
		text-align: center;

		.tips {
			font-family: PingFang SC;
			font-weight: bold;
			font-size: 32rpx;
			color: #333333;
			line-height: 45rpx;
		}
	}

	.btn {
		margin: 80rpx 30rpx;
	}

	.bottom-tips {
		width: 100%;
		position: fixed;
		bottom: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-family: PingFang SC;
		font-weight: bold;
		font-size: 24rpx;
		color: #152A8B;
		line-height: 33rpx;
	}
</style>